package cn.msqweb.controller;

import cn.msqweb.entity.Member;
import cn.msqweb.entity.ProdComm;
import cn.msqweb.model.Result;
import cn.msqweb.service.MemberService;
import cn.msqweb.util.AuthUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jakarta.annotation.Resource;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

@Api("微信小程序会员接口管理")
@RestController
@RequestMapping("p/user/setUserInfo")
public class MemberController {

    @Resource
    private MemberService memberService;

//    member-service/p/user/setUserInfo
//    修改用户信息，头像，性别，姓名
    @ApiOperation("修改用户信息，头像，性别，姓名")
    @PutMapping()
    public Result<String> setUserInfo(@RequestBody Member member){
        String openId = AuthUtils.getLoginMemberOpenId();
        Boolean modify = memberService.modifyMemberInfo(openId,member);
        return Result.handler(modify);
    }
}
